package structure

import (
	"gitcode.com/G-YT/ANN/server/api/v1"
	"gitcode.com/G-YT/ANN/server/middleware"
	"github.com/gin-gonic/gin"
)

type ServiceStationArticleRouter struct {
}

// InitServiceStationArticleRouter 初始化 服务站文章 路由信息
func (s *ServiceStationArticleRouter) InitServiceStationArticleRouter(Router *gin.RouterGroup, PublicRouter *gin.RouterGroup) {
	serviceStationArticleRouter := Router.Group("serviceStationArticle").Use(middleware.OperationRecord())
	serviceStationArticleRouterWithoutRecord := Router.Group("serviceStationArticle")
	var serviceStationArticleApi = v1.ApiGroupApp.StructureApiGroup.ServiceStationArticleApi
	appServiceStationArticleRouter := PublicRouter.Group("ss_article")
	{
		serviceStationArticleRouter.POST("createServiceStationArticle", serviceStationArticleApi.CreateServiceStationArticle)             // 新建服务站文章
		serviceStationArticleRouter.DELETE("deleteServiceStationArticle", serviceStationArticleApi.DeleteServiceStationArticle)           // 删除服务站文章
		serviceStationArticleRouter.DELETE("deleteServiceStationArticleByIds", serviceStationArticleApi.DeleteServiceStationArticleByIds) // 批量删除服务站文章
		serviceStationArticleRouter.PUT("updateServiceStationArticle", serviceStationArticleApi.UpdateServiceStationArticle)              // 更新服务站文章
	}
	{
		serviceStationArticleRouterWithoutRecord.GET("findServiceStationArticle", serviceStationArticleApi.FindServiceStationArticle)       // 根据ID获取服务站文章
		serviceStationArticleRouterWithoutRecord.GET("getServiceStationArticleList", serviceStationArticleApi.GetServiceStationArticleList) // 获取服务站文章列表
		serviceStationArticleRouterWithoutRecord.GET("getReadList", serviceStationArticleApi.GetReadList)                                   // 获取服务站文章阅读名单
	}
	{
		appServiceStationArticleRouter.GET("getArticleById", serviceStationArticleApi.GetArticleById) // 根据ID获取服务站文章
		appServiceStationArticleRouter.GET("getArticleList", serviceStationArticleApi.GetArticleList) // 获取服务站文章列表
	}
}
